#define _CRT_SECURE_NO_WARNINGS 1
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;

#include"priorityque.h"

int triangleNumber(vector<int>& nums) {
    sort(nums.begin(), nums.end());
    int n = nums.size();
    int ans = 0;
    while (n >= 3)
    {
        int max = nums[--n];
        int left = 0, right = n - 1;
        while (left < right)
        {
            if (nums[left] + nums[right] > max)
            {
                ans += (right - left);
                --right;
            }
            else
                ++left;
        }
    }
    return ans;
}

int main()
{
    vector<int> v;
    priority_que<int, vector<int>, Less<int>> pq;
    pq.push(2);
    pq.push(5);
    pq.push(1);
    pq.push(3);
    pq.push(6);
    pq.push(4);
    while(!pq.empty())
    {
        cout << pq.top() << " ";
        pq.pop();
    }
}